package com.learn.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.AccessLevel;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.experimental.Accessors;
import lombok.experimental.FieldDefaults;

import java.io.Serializable;
import java.util.Date;

/**
 * @author zhangjianshan on 2021-05-01
 */
@FieldDefaults(level = AccessLevel.PRIVATE)
@Data
@RequiredArgsConstructor(staticName = "niu")
@Accessors(chain = true)
@TableName("sys_user")
public class SysUser implements Serializable {
    private static final long serialVersionUID = 1329854007607117948L;

    @TableId(type = IdType.ASSIGN_ID)
    Long userId;

    @TableField("username")
    String username;

    @TableField("password")
    String password;

    @TableField("is_admin")
    Boolean isAdmin;

    @TableField("real_name")
    String realName;

    @TableField("create_by")
    Long createBy;

    @TableField(value = "create_time", fill = FieldFill.INSERT)
    Date createTime;

    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    Date updateTime;

    @TableField("user_status")
    Boolean userStatus;

    @ApiModelProperty("版本号")
    @TableField(fill = FieldFill.INSERT)
    @Version()
    Integer version;

    @ApiModelProperty("逻辑删除")
    @TableField(fill = FieldFill.INSERT)
    @TableLogic
    Integer deleted;
}

